package com.nuoye.camera2studydemo.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.nuoye.camera2studydemo.ChickConsumer;
import com.nuoye.camera2studydemo.R;

/**
 * adapter
 */
public class Camera2ControlAdapter extends BaseQuickAdapter<ChickConsumer, BaseViewHolder> {
    public Camera2ControlAdapter() {
        super(R.layout.item_control);
    }

    @Override
    protected void convert(BaseViewHolder holder, ChickConsumer consumer) {
        holder.setText(R.id.tvControl,consumer.toString());
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                consumer.getConsumer().accept("");
            }
        });
    }
}
